
<template>
  <!-- 物料选择 -->
  <div class="material-select">
    <!-- top -->
    <div class="top">
      <div class="top-left">
        <div class="info">
          <div class="tabs-title">
            <span style="margin-left: 20px; color: #2e61d7; font-weight: bold"
              >数据</span
            >
          </div>
        </div>
        <div class="ipt-box">
            <input class="ipt2" type="text" placeholder="输入项目编号" />
            <span
          ><img class="img" src="@/assets/search.png" alt="点击搜索"
        /></span>
        </div>
      </div>
      <div class="top-center"></div>
      <div class="top-right">
        <input class="ipt3" type="text" placeholder="输入项目编号" />
            <span
          ><img class="img" src="@/assets/search.png" alt="点击搜索"
        /></span>
      </div>
    </div>
    <!-- content -->
    <div class="content">
      <div class="left">
        <div class="e-tree-file">
          <div class="name">包件名称</div>

          <el-tree
            :data="data"
            :props="defaultProps"
            @node-click="handleNodeClick"
          ></el-tree>
        </div>
      </div>
      <div class="right">
        <div class="right-top">

          <div class="table-box">
            <el-table :data="tableData" border fit style="width: 100%">
              <el-table-column prop="date" label="细目编号" width="350px">
              </el-table-column>
              <el-table-column prop="name" label="细目名称" width="400px">
              </el-table-column>
            </el-table>
          </div>

          <ComPagination />
        </div>
        <div class="right-bottom">
          <div class="tabs-title">
            <span style="margin-left: 20px; color: #2e61d7; font-weight: bold"
              >已选</span
            >
          </div>
          <div class="table-box">
            <el-table :data="tableData" border fit style="width: 100%">
              <el-table-column prop="date" label="细目编号" width="350px">
              </el-table-column>
              <el-table-column prop="name" label="细目名称" width="400px">
              </el-table-column>
            </el-table>
          </div>
        </div>
      </div>
    </div>
    <!-- footer -->
    <div class="footer">
      <div class="left"></div>
      <div class="right">
        双击选择或取消数据
        <el-button type="mini">确定</el-button>
        <el-button type="mini" class="colse-btn">取消</el-button>
      </div>
    </div>
  </div>
</template>
<script>
import ComPagination from '@/components/pagination/pagination.vue'
export default {
    components: {
        ComPagination,
    },
    data () {
        return {
            data: [
                {
                    label: 'Lorem Ipsum1',
                    children: [
                        {
                            label: 'Lorem Ipsum1-1',
                            children: [
                                {
                                    label: 'Lorem Ipsum1-1-1',
                                },
                            ],
                        },
                    ],
                },
                {
                    label: 'Lorem Ipsum2',
                    children: [
                        {
                            label: 'Lorem Ipsum2-1',
                            children: [
                                {
                                    label: 'Lorem Ipsum2-1-1',
                                },
                            ],
                        },
                        {
                            label: 'Lorem Ipsum2-2',
                            children: [
                                {
                                    label: 'Lorem Ipsum2-2-1',
                                },
                            ],
                        },
                    ],
                },
                {
                    label: 'Lorem Ipsum3',
                    children: [
                        {
                            label: 'Lorem Ipsum3-1',
                            children: [
                                {
                                    label: 'Lorem Ipsum3-1-1',
                                },
                            ],
                        },
                        {
                            label: 'Lorem Ipsum3-2',
                            children: [
                                {
                                    label: 'Lorem Ipsum3-2-1',
                                },
                            ],
                        },
                    ],
                },
            ],
            defaultProps: {
                children: 'children',
                label: 'label',
            },
            tableData: [
                {
                    date: 'SAD11',
                    name: '直营经理部',
                },
                {
                    date: 'SAD11',
                    name: '直营经理部',
                },
                {
                    date: 'SAD11',
                    name: '直营经理部',
                },
            ],
        }
    },
    methods: {
        handleNodeClick () {},
    },
}
</script>
<style lang="scss" scoped>
.material-select {
  width: 80%;
  height: 80%;
  display: flex;
  margin: auto;

  flex-direction: column;
  .top {
    height: 50px;
    // border: 1px solid #000;
    line-height: 50px;
    display: flex;

    .top-left {
      width: 300px;

      display: flex;
      .info {
        width: 50px;
        position: relative;
        .tabs-title::before {
          content: "";
          height: 22px;
          width: 8px;
          border-radius: 40px;
          background-color: #2e61d7;
          display: block;
          position: absolute;
          left: 0px;
          top: 14px;
        }
      }
      .ipt-box {
        flex: 1;
        position: relative;
        .ipt2 {
      height: 23px;
      border-radius: 5px;

      margin-bottom: 15px;
      margin-left: 35px;
      cursor: pointer;
      border: 1px solid #ccc;
    }
    .img {
      width: 15px;
      height: 15px;
      position: absolute;
      top: 19px;
      right: 62px;
      cursor: pointer;
    }
    ::placeholder {
      padding-left: 10px;
      color: #cccc;
    }
      }
    }
    .top-center {
      flex: 2;
    }
    .top-right {
      flex: 1;
      position: relative;
      .ipt3 {
      height: 23px;
      border-radius: 5px;
      margin-top: 15px;
      margin-bottom: 15px;
      margin-left: 60px;
      cursor: pointer;
      border: 1px solid #ccc;

    }

    img {
      width: 15px;
      height: 15px;
      position: absolute;
      top: 20px;
      right: 20px;
      cursor: pointer;
    }
    ::placeholder{
       color: #cccc;
      padding-left: 10px;
    }
    }

  }
  .content {
    flex: 1;
    margin-top: 10px;
    display: flex;

    .left {
      width: 280px;

      overflow-y: auto;
      margin-right: 20px;
      border-radius: 5px;
      position: relative;
      box-sizing: border-box;
      border: 1px solid #ccc;
      .name {
        height: 40px;
        line-height: 40px;
        text-align: center;
        font-weight: 700;

        background-color: rgb(224, 231, 249);
      }
    }
    .right {
      flex: 1;
      border-radius: 5px;
      //  border: 1px solid #ccc;
      display: flex;
      flex-direction: column;
      .right-top {
        flex: 1;

        .table-box {
          width: 100%;
          ::v-deep.has-gutter th {
            background: #e0e7f9 !important;
            color: #000;
          }
          ::v-deep.el-table--enable-row-hover .el-table__body tr:hover {
            font-weight: bold;
          }
          ::v-deep.el-table ::v-deep .el-table__expand-icon--expanded {
            transform: none;
          }
          ::v-deep.el-tree ::v-deep .el-tree-node__expand-icon.expanded {
            -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
          }
          ::v-deep.cell {
            display: flex;
            align-items: center;
          }
        }
        ::v-deep.e-pagination {
          margin-top: 5px !important;
        }
      }
      .right-bottom {
        flex: 1;
        border-radius: 5px;

        margin-top: 10px;
        position: relative;
        .tabs-title {
          margin-bottom: 10px;
        }
        .tabs-title::before {
          content: "";
          height: 22px;
          width: 8px;
          border-radius: 40px;
          background-color: #2e61d7;
          display: block;
          position: absolute;
          left: 0px;
          top: -2px;
        }
        ::v-deep.has-gutter th {
          background: #e0e7f9 !important;
          color: #000;
        }
        ::v-deep.el-table--enable-row-hover .el-table__body tr:hover {
          font-weight: bold;
        }
        ::v-deep.el-table ::v-deep .el-table__expand-icon--expanded {
          transform: none;
        }
        ::v-deep.el-tree ::v-deep .el-tree-node__expand-icon.expanded {
          -webkit-transform: rotate(0deg);
          transform: rotate(0deg);
        }
        ::v-deep.cell {
          display: flex;
          align-items: center;
        }
      }
    }
  }
  .footer {
    height: 50px;
    margin-top: 20px;
    display: flex;
    background-color: #eff2f6;
    border: 1px solid #ccc;
    .left {
      width: 70%;
      height: 50px;
    }
    .right {
      line-height: 50px;
      font-weight: 500;
      color: rgb(233, 84, 66);
      font-size: 14px;
      .colse-btn {
        background-color: #fff;
        color: #000;
      }
    }
    ::v-deep.el-button--mini {
      width: 60px;
      color: #fff;
      margin-left: 10px;
      background-color: rgb(46, 97, 215);
    }
  }
}
</style>

